<extend name="template:common" />
<block name="css">
    <css href="__ZTREE__/css/zTreeStyle/zTreeStyle.css" />
</block>
<block name="js">
    <script src="__ZTREE__/js/jquery.ztree.core.js"></script>
    <script>
        $(function(){
              $('#namex').focus(function(){
                  $val = $('#namex').val();
              }).blur(function(){
                  if($('#namex').val()==''){
                      $('#namex').val($val);
                  }
              });
              
            var setting = {
                data: {
                    simpleData: {
                        enable: true,
                        pIdkey:'parent_id'
                    }
                }
            };

            var zNodes = {$jsonData};

            $(document).ready(function(){
              var treeObj = $.fn.zTree.init($("#treeDemo"), setting, zNodes);
              
            });

        });
    </script>
<block name="main">
    <h1>
        <span class="action-span1"><a href="{:U('index')}">商品管理</a></span>
        <span id="search_id" class="action-span1"> - {$meta_title} </span>
        <div style="clear:both"></div>
    </h1>
    <div class="main-div">
        <form method="post" action="{:U()}"enctype="multipart/form-data" >
            <table cellspacing="1" cellpadding="3" width="100%">
                <tr>
                    <td class="label">商品名称</td>
                    <td>
                        <input type="text" id="namex" name="name" maxlength="60" value="{$row.name}" />
                        <span class="require-field">*</span>
                    </td>
                </tr>
                <tr>
                    <td class="label">父级分类</td>
                    <td>
                        <ul id="treeDemo" class="ztree"></ul>
                    </td>
                </tr>
                <tr>
                    <td class="label">商品描述</td>
                    <td>
                        <textarea  name="intro" cols="60" rows="4"  >{$row.intro}</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="label">排序</td>
                    <td>
                        <input type="text" name="sort" maxlength="40" size="15" value="{$row.sort}" />
                    </td>
                </tr>
                <tr>
                    <td class="label">是否显示</td>
                    <td>
                        <input type="radio" name="status" value="1" checked="checked" /> 是
                        <input type="radio" name="status" value="0"  /> 否
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><br />
                        <input type="hidden" value="{$row.id}" name="id">
                        <input type="submit" class="button" value=" 确定 " />
                        <input type="reset" class="button" value=" 重置 " />
                    </td>
                </tr>
            </table>
        </form>
    </div>
</block>
</block>
